#region Copyright(c) 2006 ZO, All right reserved.
// -----------------------------------------------------------------------------
// Copyright(c) 2006 ZO, All right reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//   1.  Redistribution of source code must retain the above copyright notice,
//       this list of conditions and the following disclaimer.
//   2.  Redistribution in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//   3.  The name of the author may not be used to endorse or promote products
//       derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// -----------------------------------------------------------------------------
#endregion


#region Using directives

using System;
using System.ComponentModel;
using System.Windows.Forms;

#endregion

namespace ZO.SmartCore.Windows.Forms.OptionControls
{
	/// <summary>Represents a node of a <see cref="T:System.Windows.Forms.TreeView"></see>.</summary>
	[Serializable, DefaultProperty("Text"), TypeConverter(typeof(TreeNodeConverter))]
	public sealed class SmartTreeOptionNode : TreeNode
	{

		#region Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode"></see> class.
		/// </summary>
		public SmartTreeOptionNode()
			: base()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode"></see> class with the specified label text.
		/// </summary>
		/// <param name="text">The label <see cref="P:System.Windows.Forms.TreeNode.Text"></see> of the new tree node.</param>
		public SmartTreeOptionNode(string text)
			: base(text)
		{
		}


		/// <summary>
		/// Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode"></see> class with the specified label text and child tree nodes.
		/// </summary>
		/// <param name="text">The label <see cref="P:System.Windows.Forms.TreeNode.Text"></see> of the new tree node.</param>
		/// <param name="children">An array of child <see cref="T:System.Windows.Forms.TreeNode"></see> objects.</param>
		public SmartTreeOptionNode(string text, SmartTreeOptionNode[] children)
			: base(text, children)
		{
		}



		/// <summary>
		/// Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode"></see> class with the specified label text, child tree nodes, and images to display when the tree node is in a selected and unselected state.
		/// </summary>
		/// <param name="text">The label <see cref="P:System.Windows.Forms.TreeNode.Text"></see> of the new tree node.</param>
		/// <param name="imageIndex">The index value of <see cref="T:System.Drawing.Image"></see> to display when the tree node is unselected.</param>
		/// <param name="selectedImageIndex">The index value of <see cref="T:System.Drawing.Image"></see> to display when the tree node is selected.</param>
		/// <param name="children">An array of child <see cref="T:System.Windows.Forms.TreeNode"></see> objects.</param>
		public SmartTreeOptionNode(string text, int imageIndex, int selectedImageIndex, SmartTreeOptionNode[] children)
			: base(text, imageIndex, selectedImageIndex, children)
		{
		}




		/// <summary>
        /// Initializes a new instance of the <see cref="SmartTreeOptionNode"/> class.
		/// </summary>
		/// <param name="text">The text.</param>
		/// <param name="page">The page.</param>
		public SmartTreeOptionNode(string text, SmartOptionPage page)
			: this(text)
		{
			this.OptionPage = page;
		}

		/// <summary>
        /// Initializes a new instance of the <see cref="SmartTreeOptionNode"/> class.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <param name="page">The page.</param>
		/// <param name="text">The text.</param>
		public SmartTreeOptionNode(string name, SmartOptionPage page, string text)
			: this(name, page)
		{
			this.Name = name;
            Text = text;
		}


		/// <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode"></see> class with the specified label text and images to display when the tree node is in a selected and unselected state.</summary>
		/// <param name="selectedImageIndex">The index value of <see cref="T:System.Drawing.Image"></see> to display when the tree node is selected. </param>
		/// <param name="imageIndex">The index value of <see cref="T:System.Drawing.Image"></see> to display when the tree node is unselected. </param>
		/// <param name="text">The label <see cref="P:System.Windows.Forms.TreeNode.Text"></see> of the new tree node. </param>
		public SmartTreeOptionNode(string text, int imageIndex, int selectedImageIndex)
			: base(text, imageIndex, selectedImageIndex)
		{

		}



		#endregion

		#region Destructor

		#endregion

		#region Fields


		private SmartOptionPage _Page;

		private SmartTreeOptionNodes _Nodes;

		#endregion

		#region Events

		#endregion

		#region Operators

		#endregion

		#region Properties



		#endregion

		#region Methods





		/// <summary>
		/// Gets or sets the nodes.
		/// </summary>
		/// <value>The nodes.</value>
		public new SmartTreeOptionNodes Nodes
		{
			get
			{
				if (_Nodes == null)
				{
					_Nodes = new SmartTreeOptionNodes(base.Nodes);
				}
				return _Nodes;
			}
		}

		/// <summary>
		/// Gets or sets the page.
		/// </summary>
		/// <value>The page.</value>
		public SmartOptionPage OptionPage
		{
			get { return _Page; }
			set { _Page = value; }
		}






		#endregion
	}
}
